﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Delphi.Mimir.Data.Entities.Raw.Mappings {
    public class RawRevenueEstimateMap : EntityTypeConfiguration<RawRevenueEstimate> { 
        public RawRevenueEstimateMap() {
            /******************************************************************
            /* Table
            /*****************************************************************/
            ToTable("raw.eod_revenue_estimates");

            /******************************************************************
            /* Primary Key
            /*****************************************************************/
            HasKey(a => a.aer_id);

            /******************************************************************
            /* Index
            /*****************************************************************/
            // None

            /******************************************************************
            /* Relationships
            /*****************************************************************/
            // None

            /******************************************************************
            /* Properties
            /*****************************************************************/
            Property(a => a.aer_id)
                .IsRequired()
                .HasColumnName("aer_id");

            Property(a => a.aer_sym_cd)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("aer_sym_cd");

            Property(a => a.aer_exc_cd)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("aer_exc_cd");

            Property(a => a.aer_dt)
                .IsRequired()
                .HasColumnName("aer_dt");

            Property(a => a.aer_period)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("aer_period");

            Property(a => a.aer_curt_fg)
                .IsRequired()
                .HasColumnName("aer_curt_fg");

            Property(a => a.aer_estimate_dt)
                .IsRequired()
                .HasColumnName("aer_estimate_dt");

            Property(a => a.aer_avg_estimate)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aer_avg_estimate");

            Property(a => a.aer_low_estimate)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aer_low_estimate");

            Property(a => a.aer_high_estimate)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aer_high_estimate");

            Property(a => a.aer_year_ago)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aer_year_ago");

            Property(a => a.aer_sales_growth)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aer_sales_growth");

            Property(a => a.aer_nof_analyst)
                .IsOptional()
                .HasColumnName("aer_nof_analyst");
        }
    }
}
